import request from '@/utils/request'
import querystring from 'querystring'

export function getChanceById(id) {
  return request.get('/chance/detail/' + id)
}

export function addChance(param) {
  return request.post('/chance/save', param)
}

export function deleteChance(id) {
  return request.delete('/chance/del/' + id)
}

export function chanceSetChance(options) {
  return request.put('/chance/chanceSet', options)
}

export function disposeChance(options) {
  return request.post('/chance/dispose', options)
}

export function chanceList(param, pageSize, pageNo) {
  const data = {
    pageNo,
    pageSize,
    param: {
      ...param
    }
  }
  return request.post('/chance/page', data)
}

export function chanceDispose() {
  return request.post('/chance/dispose')
}

export function chanceFollowUpSave(options) {
  return request.post('/chance/followUpSave', options)
}

export function followUpByChanceId(id) {
  return request.get('/chance/followUpByChanceId/' + id)
}
